<script setup>
    import { ref } from 'vue';

    const num = ref(0)
    const addNum = () => {
        num.value++
    }
</script>

<template>
    <h2>num的值为：{{ num }}</h2>
    <button @click="addNum">修改值</button>
</template>